package com.ruoyi.production.mapper;

import com.ruoyi.production.domain.PlanModelInfo;
import com.ruoyi.production.domain.WorkOrderInfo;
import com.ruoyi.project.domain.BomPartstRef;

import java.util.List;

/**
 * 工单Mapper接口
 *
 * @author ruoyi
 * @date 2022-09-01
 */
public interface WorkOrderInfoMapper {
    /**
     * 查询工单
     *
     * @param id 工单主键
     * @return 工单
     */
    public WorkOrderInfo selectWorkOrderInfoById(Long id);

    /**
     * 查询工单列表
     *
     * @param workOrderInfo 工单
     * @return 工单集合
     */
    public List<WorkOrderInfo> selectWorkOrderInfoList(WorkOrderInfo workOrderInfo);

    /**
     * 新增工单
     *
     * @param workOrderInfo 工单
     * @return 结果
     */
    public int insertWorkOrderInfo(WorkOrderInfo workOrderInfo);

    /**
     * 修改工单
     *
     * @param workOrderInfo 工单
     * @return 结果
     */
    public int updateWorkOrderInfo(WorkOrderInfo workOrderInfo);

    /**
     * 删除工单
     *
     * @param id 工单主键
     * @return 结果
     */
    public int deleteWorkOrderInfoById(Long id);

    /**
     * 批量删除工单
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteWorkOrderInfoByIds(Long[] ids);

    /**
     * 批量删除生产计划
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePlanModelInfoByWorkOrderIds(Long[] ids);

    /**
     * 批量新增生产计划
     *
     * @param planModelInfoList 生产计划列表
     * @return 结果
     */
    public int batchPlanModelInfo(List<PlanModelInfo> planModelInfoList);


    /**
     * 通过工单主键删除生产计划信息
     *
     * @param id 工单ID
     * @return 结果
     */
    public int deletePlanModelInfoByWorkOrderId(Long id);

    /**
     * 获取构件表格
     *
     * @param planModelInfo
     * @return
     */
    public List<PlanModelInfo> getCompomentList(PlanModelInfo planModelInfo);


    public BomPartstRef getBomPartstRef(Long modelId);

    public PlanModelInfo getPlanModelInfo(Long id);

    public int delPlanModelInfo(Long id);

    public int updatePlanModelInfo(PlanModelInfo planModelInfo);

    public List<PlanModelInfo> getPlanModelInfoList(long workOrderId);

    public int checkUpdateWorkOrder();

}
